<template>
	<view class="c-reply">
		<textarea class="text-reply" :value="cotent"   @input="textareaInput($event,index)" value="" maxlength="150" placeholder="请输入你的评论(150字以内)" />
		<view class="btn-wapper">
			<button class="btn-item clean" type="default" size="mini" @click="cancel()">取消</button>
			<button class="btn-item submit" :disabled="cotent==''" type="warn" size="mini" @click="submit()">发布</button>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			// 是否显示
			show:{
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				cotent:''
			};
		},
		methods: {
			cancel() {
				this.$emit("cancel",false);
			},
			textareaInput(e,index) {
				this.cotent = e.detail.value
			},
			submit() {
				this.$emit('submit',this.cotent)
			}
		}
	}
</script>

<style lang="scss" scoped>
.c-reply {
	padding: 20rpx 0;
}
.text-reply {
	box-sizing: border-box;
	height: 200rpx;
	width: 100%;
	padding: 20rpx;
	border: 1rpx solid #f8f8f8;
	border-radius: 20rpx;
}
.btn-wapper {
	display: flex;
	.btn-item {
		flex: 1;
		height: 70rpx;
		line-height: 70rpx;
		border-radius: 50rpx;
		margin: 20rpx;
		&::after {
			border-radius: 50px;
		}
	}
}
</style>
